import request from '@/utils/request'

const apis = {
    INFO_LIST: '/information/getinformationlist',
    INFO_DETAIL: '/information/getinformation',
    THUMBS_UP_INFO: '/information/getthumbsup',
    COURSE_INFO_LIST: '/information/getcoursebegininfolist',
    TOGGLE_THUMBS_UP: '/information/togglethumbsup',
    ADD_REPLY: '/information/addreply',
    REPLY_LIST: '/information/getreplylist',
    THUMBS_UP_CNT: '/information/getthumbsupcount'
}

export default {
    
    // 信息列表
    getInfoList(data) {
        let dt = data || {};
        return request.post(apis.INFO_LIST, dt.params, {
            headers: dt.headers || {}
        });
    },

    // 信息详情
    getInfoDetail(data) {
        let dt = data || {};
        return request.post(apis.INFO_DETAIL, dt.params, {
            headers: dt.headers || {}
        });
    },

    // 信息点赞情况
    getThumbsUpInfo(data) {
        let dt = data || {};
        return request.post(apis.THUMBS_UP_INFO, dt.params, {
            headers: dt.headers || {}
        });
    },

    // 点赞
    toggleThumbsUp(data) {
        let dt = data || {};
        return request.post(apis.TOGGLE_THUMBS_UP, dt.params, {
            headers: dt.headers || {}
        });
    },

    // 开班信息
    getCourseInfoList(data) {
        let dt = data || {};
        return request.post(apis.COURSE_INFO_LIST, dt.params, {
            headers: dt.headers || {}
        });
    },

    addReply(data) {
        let dt = data || {};
        return request.post(apis.ADD_REPLY, dt.params, {
            headers: dt.headers || {}
        });
    },

    getReplyList(data) {
        let dt = data || {};
        return request.post(apis.REPLY_LIST, dt.params, {
            headers: dt.headers || {}
        });
    },

    getThumbsUpCount(data) {
        let dt = data || {};
        return request.post(apis.THUMBS_UP_CNT, dt.params, {
            headers: dt.headers || {}
        });
    },
}